<template>
  <div class="page-container">
    <!-- 核心功能模块 -->
    <section class="core-features-section">
      <div class="section-header">
        <h2 class="section-title">核心功能</h2>
        <p class="section-subtitle">强大的AI助手，带来前所未有的互动体验</p>
      </div>

      <div class="features-grid">
        <div v-for="feature in coreFeatures" :key="feature.id" class="feature-card">
          <div class="feature-icon">
            <i :class="feature.iconClass"></i>
          </div>
          <h3 class="feature-title">{{ feature.title }}</h3>
          <p class="feature-description">{{ feature.description }}</p>
          <div class="feature-tags">
            <span v-for="tag in feature.tags" :key="tag" class="feature-tag">
              {{ tag }}
            </span>
          </div>
        </div>
      </div>
    </section>

    <!-- 应用场景模块 -->
    <section class="scenarios-section">
      <div class="section-header">
        <h2 class="section-title">应用场景</h2>
        <p class="section-subtitle">适用于多种学习与工作环境</p>
      </div>

      <div class="scenarios-grid">
        <div v-for="scenario in applicationScenarios" :key="scenario.id" class="scenario-card">
          <div class="scenario-header">
            <h3 class="scenario-title">{{ scenario.title }}</h3>
          </div>
          <div class="scenario-body">
            <p class="scenario-description">{{ scenario.description }}</p>
            <div class="scenario-tags">
              <span v-for="tag in scenario.tags" :key="tag" class="scenario-tag">
                {{ tag }}
              </span>
            </div>
            <div class="scenario-stats">
              <span class="stat-users">{{ scenario.users }}+ 用户</span>
              <span class="stat-rating">{{ scenario.rating }} 好评</span>
            </div>
          </div>
        </div>
      </div>
    </section>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'

interface CoreFeature {
  id: number
  title: string
  description: string
  iconClass: string
  tags: string[]
}

interface ApplicationScenario {
  id: number
  title: string
  description: string
  tags: string[]
  users: string
  rating: string
}

const coreFeatures = ref<CoreFeature[]>([
  {
    id: 1,
    title: '智能对话',
    description: '基于先进AI技术，提供自然流畅的对话体验',
    iconClass: 'icon-chat',
    tags: ['自然语言', '上下文理解', '情感识别'],
  },
  {
    id: 2,
    title: '多角色对话',
    description: '支持多角色模式，满足不同场景的对话需求',
    iconClass: 'icon-users',
    tags: ['角色扮演', '个性化定制', '场景切换'],
  },
  {
    id: 3,
    title: '能力提升',
    description: '通过智能辅导，快速提升各方面能力',
    iconClass: 'icon-growth',
    tags: ['专业提升', '技能提升', '学习辅导'],
  },
  {
    id: 4,
    title: '场景丰富',
    description: '覆盖学习、工作、生活等多个应用场景',
    iconClass: 'icon-scenarios',
    tags: ['场景全面', '持续更新', '专业定制'],
  },
])

const applicationScenarios = ref<ApplicationScenario[]>([
  {
    id: 1,
    title: '商务沟通',
    description: '帮助完成商务沟通，提升专业沟通能力',
    tags: ['商务礼仪', '商务沟通', '创业助手'],
    users: '2800',
    rating: '4.8',
  },
  {
    id: 2,
    title: '面试培训',
    description: '全方位模拟面试，帮你实现跨越目标',
    tags: ['求职指导', '职场规划', '自我营销'],
    users: '2400',
    rating: '4.9',
  },
  {
    id: 3,
    title: '精准测试',
    description: '智能生成题库，提升错题分析针对性',
    tags: ['智能出题', '答案分析', '习题解析'],
    users: '1800',
    rating: '4.7',
  },
  {
    id: 4,
    title: '数学培训',
    description: '系统性培训，提升数学方法和思维',
    tags: ['数学思维', '解题策略', '学生辅导'],
    users: '1500',
    rating: '4.5',
  },
])
</script>

<style scoped>
.page-container {
  background-color: white;
  /* background-image:
    radial-gradient(circle at 20px 20px, #e2e8f0 2px, transparent 0),
    radial-gradient(circle at 60px 60px, #e2e8f0 2px, transparent 0); */
  background-size: 80px 80px;
  margin-bottom: 2.4rem;
}

.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.section-subtitle {
  font-size: 16px;
  color: #718096;
  margin: 0;
  font-weight: 400;
}

/* 核心功能样式 */
.core-features-section {
  max-width: 1300px;
  margin: 0 auto 80px;
  padding: 0 40px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.feature-card {
  background: white;
  padding: 2.5rem;
  border-radius: 0.75rem;
  text-align: center;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease-out;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.feature-icon {
  width: 60px;
  height: 60px;
  background: #e6f3ff;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon i {
  font-size: 24px;
  color: #4299e1;
}

.feature-title {
  font-size: 18px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 12px;
  line-height: 1.4;
}

.feature-description {
  font-size: 14px;
  color: #718096;
  line-height: 1.6;
  margin-bottom: 20px;
}

.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.feature-tag {
  background: #f8fafc;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: #64748b;
}

/* 应用场景样式 */
.scenarios-section {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 40px;
}

.scenarios-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.scenario-card {
  background: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: all 0.3s ease-out;
}

.scenario-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(66, 153, 225, 0.15);
}

.scenario-header {
  height: 200px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(6, 182, 212, 0.1));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #3b82f6;
}

.scenario-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.scenario-body {
  padding: 20px;
}

.scenario-description {
  font-size: 14px;
  color: #4a5568;
  line-height: 1.6;
  margin-bottom: 16px;
}

.scenario-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.scenario-tag {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  padding: 0.25rem 0.5rem;
  border-radius: 0.125rem;
  font-size: 0.875rem;
}

.scenario-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #4a5568;
}

.stat-users {
  font-weight: 500;
}

.stat-rating {
  font-weight: 500;
}
</style>
